package com.ps.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ps.pojo.User;
import com.ps.mapper.UserMapper;
import com.ps.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2020-12-18
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User findUser(String usercode) {
        LambdaQueryWrapper<User> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(User::getUsercode,usercode);
        return userMapper.selectOne(wrapper);
    }
}
